package org.wen.soft.util;

import java.io.File;

public class StrCastUtil {
    private static final String separator = File.separator;

    /**
     * 处理路径上的分隔符
     */
    public static String pathToPath(String path) {
        path = path.replace("\\", separator).replace("/", separator);
        while (path.contains(separator + separator)) {
            path = path.replace(separator + separator, separator);
        }
        return path;
    }

    public static String classNameToPath(String className) {
        return className.replace(".", separator);
    }

    public static String pathToClassName(String path) {
        return path.replace("\\", ".").replace("/", ".");
    }


}
